import { ApiProperty } from '@nestjs/swagger';
import { IsIn, IsNotEmpty, Length } from 'class-validator';

export class CreateInformationDto {}

export class PublicInformationDto {
  @ApiProperty({required:true,description:'文章内容'})
  @Length(20, 180, { message: '内容字数应在20到180字之间' })
  @IsNotEmpty()
  content: string; //文章内容
  @ApiProperty({required:true,description:"文章标题"})
  @IsNotEmpty()
  @Length(2, 10)
  title: string; //文章标题
  @ApiProperty({required:true,description:"文章类别"})
  @IsNotEmpty()
  @IsIn([1, 2, 3, 4])
  type :number=1 ; //文章类别
  @ApiProperty({required:true,description:"文章展示天数",default:1})
  @IsNotEmpty()
  dayjs: number=1; //文章展示天数
}
